package com.nbsaas.boot.merchant.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "商家保证金", model = "商家保证金")
@Entity
@Table(name = "bs_merchant_deposit")
@Comment("商家保证金表")
public class MerchantDeposit extends AbstractEntity {

    @Comment("商家ID")
    @FormField(title = "商家", sortNum = "1", type = InputType.select, required = true)
    private Long merchantId;

    @Comment("保证金单号")
    @SearchItem(name = "depositNo", key = "depositNo", label = "保证金单号")
    @FormField(title = "保证金单号", sortNum = "2", grid = true, required = true)
    @Column(length = 50, nullable = false, unique = true)
    private String depositNo;

    @Comment("保证金金额")
    @FormField(title = "保证金金额", sortNum = "3", type = InputType.el_input_number, grid = true, required = true)
    @Column(precision = 10, scale = 2, nullable = false)
    private BigDecimal amount;

    @Comment("支付方式")
    @SearchItem(name = "paymentMethod", key = "paymentMethod", label = "支付方式")
    @FormField(title = "支付方式", sortNum = "4", grid = true, type = InputType.select)
    @Column(length = 20)
    private String paymentMethod;

    @Comment("支付时间")
    @FormField(title = "支付时间", sortNum = "5")
    private Date paymentTime;

    @Comment("支付状态")
    @SearchItem(name = "paymentStatus", key = "paymentStatus", label = "支付状态")
    @FormField(title = "支付状态", sortNum = "6", grid = true, type = InputType.select)
    @Column(length = 20)
    private String paymentStatus;

    @Comment("退还金额")
    @FormField(title = "退还金额", sortNum = "7", type = InputType.el_input_number, grid = true)
    @Column(precision = 10, scale = 2)
    private BigDecimal refundAmount;

    @Comment("退还时间")
    @FormField(title = "退还时间", sortNum = "8")
    private Date refundTime;

    @Comment("退还状态")
    @SearchItem(name = "refundStatus", key = "refundStatus", label = "退还状态")
    @FormField(title = "退还状态", sortNum = "9", grid = true, type = InputType.select)
    @Column(length = 20)
    private String refundStatus;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "10", type = InputType.textarea)
    @Column(length = 1000)
    private String remark;
} 